<html>
	<head>
		<!-- Title, CSS , JQuery includes -->
		<title>Team Registration</title>
		<link href="../resources/css/register.css" rel="stylesheet" type="text/css">
		<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
	</head>
	<body>
		<!-- include nav menue -->
		<?php include '../view/header.php'; ?>
		<div style="clear:both;"></div>
		<div class="mainbox" > <p align="center"> ** Register **</p>
			<div id="reg_container">
				<!-- form contaiing all information necessary to register a team -->
				<form id="register" action="../model/register.php" method="post">
					<div id="dropdowns">
						Sport : 
						<select id="sport" name="sport">
							<option selected ="selected" value="none" >Select Sport</option>
							<?php for ($i = 0; $i < sizeof($sports); $i++) {?>
							<option value="<?php echo $sports[$i];?>"><?php echo $sports[$i];?></option>
							<?php } ?>
						</select>
						Level : 
						<select id="level" name="level">
							<option selected="selected" value="none">Select Level</option>
							<?php for ($j = 0; $j <sizeof($levels);$j++) {?>
							<option value="<?php echo $levels[$j];?>"><?php echo $levels[$j];?></option>
							<?php } ?>
						</select>
					</div>
					<div id="reg_radio">Registration Type : 
						<input id="individual" type="radio" name="reg_type" value="individual">Individual</input>
						<input id="team" type="radio" name="reg_type" value="team">Team</input>
					</div>
					<div id="team_name">Team Name : <input type="text" name="teamName"/></div>
					<div id="note">
						Additional Note :</br> 
						<textarea name="note" rows="10" cols="50"></textarea>
					</div>
					<div id="fee">
						Fee : <label id="individualFee"><?php echo $individualFee;?></label><label id="teamFee"><?php echo $teamFee;?></label>
					</div>
					<div id="payment">Payment Type :
						<input id="wc" type="radio" name="payment_type" value="wc">Wat Card</input>
						<input id="cc" type="radio" name="payment_type" value="cc">CreditCard</input>
						<br/>
						Watchard / CreditCard Number : <input id="cardNumber" type="text"/>
					</div>
					<input id="submit" name="submit" type="submit" value="Process"/>
				</form>
			</div>
		</div>
		<script type="text/javascript">
			//js with the use of jquery to show and hide fields on the form depending on team or individual registration
			$(document).ready(function(){
				<?php if(isset($processed)){ ?>
					alert("Your team has been registered");
				<?php }?>
				$('#team_name').hide();
				$('#teamFee').hide();
				$('#individualFee').hide();
				
				$('#team').click(function(){
					$('#team_name').show();
					$('#individualFee').hide();
					$('#teamFee').show();	
				});
				
				$('#individual').click(function(){
					$('#team_name').hide();
					$('#teamFee').hide();	
					$('#individualFee').show();
				});
			});
		</script>
	</body>
</html>
